// electron.vite.config.ts
import { resolve } from "path";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import vue from "@vitejs/plugin-vue";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
var __electron_vite_injected_dirname = "D:\\newwork\\sale\\sale";
console.log(resolve(__electron_vite_injected_dirname, "src/preload/index.js"));
var electron_vite_config_default = defineConfig({
  main: {
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    build: {
      rollupOptions: {
        input: {
          index: resolve(__electron_vite_injected_dirname, "src/preload/index.ts"),
          secondscreen: resolve(__electron_vite_injected_dirname, "src/preload/secondscreen.ts")
        }
      }
    },
    plugins: [externalizeDepsPlugin()]
  },
  renderer: {
    build: {
      rollupOptions: {
        input: {
          index: resolve(__electron_vite_injected_dirname, "src/renderer/index.html"),
          secondscreen: resolve(__electron_vite_injected_dirname, "src/renderer/secondscreen.html")
        }
      }
    },
    resolve: {
      alias: {
        "@renderer": resolve("src/renderer/src")
      }
    },
    plugins: [vue(), createSvgIconsPlugin({
      // 指定需要缓存的图标文件夹
      iconDirs: [resolve(process.cwd(), "src/renderer/src/assets/svg")],
      // 指定symbolId格式
      symbolId: "icon-[dir]-[name]"
    })],
    css: {
      preprocessorOptions: {
        scss: { api: "modern-compiler" }
      }
    },
    server: {
      // 代理规则
      "proxy": {
        "/api": {
          // 目标服务器地址
          // http://192.168.22.208:8081
          target: "http://39.101.143.18:8081",
          // 是否改变请求的origin（用于解决跨域问题）
          changeOrigin: true,
          // 请求路径重写规则
          rewrite: (p) => p.replace(/^\/api/, "")
        }
      }
    }
  }
});
export {
  electron_vite_config_default as default
};
